package us.ajg0702.leaderboards.libs.hikari.pool;

import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;


public abstract class ProxyStatement
        implements Statement {
    protected final ProxyConnection connection;
    final Statement delegate;
    private boolean isClosed;
    private ResultSet proxyResultSet;

    ProxyStatement(ProxyConnection connection, Statement statement) {
        this.connection = connection;
        this.delegate = statement;
    }


    final SQLException checkException(SQLException e) {
        return this.connection.checkException(e);
    }


    public final String toString() {
        String delegateToString = this.delegate.toString();
        return getClass().getSimpleName() + '@' + System.identityHashCode(this) + " wrapping " + delegateToString;
    }


    public final void close() throws SQLException {
        synchronized (this) {
            if (this.isClosed) {
                return;
            }

            this.isClosed = true;
        }

        this.connection.untrackStatement(this.delegate);

        try {
            this.delegate.close();
        } catch (SQLException e) {
            throw this.connection.checkException(e);
        }
    }


    public Connection getConnection() throws SQLException {
        return this.connection;
    }


    public boolean execute(String sql) throws SQLException {
        this.connection.markCommitStateDirty();
        return this.delegate.execute(sql);
    }


    public boolean execute(String sql, int autoGeneratedKeys) throws SQLException {
        this.connection.markCommitStateDirty();
        return this.delegate.execute(sql, autoGeneratedKeys);
    }


    public ResultSet executeQuery(String sql) throws SQLException {
        this.connection.markCommitStateDirty();
        ResultSet resultSet = this.delegate.executeQuery(sql);
        return ProxyFactory.getProxyResultSet(this.connection, this, resultSet);
    }


    public int executeUpdate(String sql) throws SQLException {
        this.connection.markCommitStateDirty();
        return this.delegate.executeUpdate(sql);
    }


    public int[] executeBatch() throws SQLException {
        this.connection.markCommitStateDirty();
        return this.delegate.executeBatch();
    }


    public int executeUpdate(String sql, int autoGeneratedKeys) throws SQLException {
        this.connection.markCommitStateDirty();
        return this.delegate.executeUpdate(sql, autoGeneratedKeys);
    }


    public int executeUpdate(String sql, int[] columnIndexes) throws SQLException {
        this.connection.markCommitStateDirty();
        return this.delegate.executeUpdate(sql, columnIndexes);
    }


    public int executeUpdate(String sql, String[] columnNames) throws SQLException {
        this.connection.markCommitStateDirty();
        return this.delegate.executeUpdate(sql, columnNames);
    }


    public boolean execute(String sql, int[] columnIndexes) throws SQLException {
        this.connection.markCommitStateDirty();
        return this.delegate.execute(sql, columnIndexes);
    }


    public boolean execute(String sql, String[] columnNames) throws SQLException {
        this.connection.markCommitStateDirty();
        return this.delegate.execute(sql, columnNames);
    }


    public long[] executeLargeBatch() throws SQLException {
        this.connection.markCommitStateDirty();
        return this.delegate.executeLargeBatch();
    }


    public long executeLargeUpdate(String sql) throws SQLException {
        this.connection.markCommitStateDirty();
        return this.delegate.executeLargeUpdate(sql);
    }


    public long executeLargeUpdate(String sql, int autoGeneratedKeys) throws SQLException {
        this.connection.markCommitStateDirty();
        return this.delegate.executeLargeUpdate(sql, autoGeneratedKeys);
    }


    public long executeLargeUpdate(String sql, int[] columnIndexes) throws SQLException {
        this.connection.markCommitStateDirty();
        return this.delegate.executeLargeUpdate(sql, columnIndexes);
    }


    public long executeLargeUpdate(String sql, String[] columnNames) throws SQLException {
        this.connection.markCommitStateDirty();
        return this.delegate.executeLargeUpdate(sql, columnNames);
    }


    public ResultSet getResultSet() throws SQLException {
        ResultSet resultSet = this.delegate.getResultSet();
        if (resultSet != null) {
            if (this.proxyResultSet == null || ((ProxyResultSet) this.proxyResultSet).delegate != resultSet) {
                this.proxyResultSet = ProxyFactory.getProxyResultSet(this.connection, this, resultSet);
            }
        } else {

            this.proxyResultSet = null;
        }
        return this.proxyResultSet;
    }


    public ResultSet getGeneratedKeys() throws SQLException {
        ResultSet resultSet = this.delegate.getGeneratedKeys();
        if (this.proxyResultSet == null || ((ProxyResultSet) this.proxyResultSet).delegate != resultSet) {
            this.proxyResultSet = ProxyFactory.getProxyResultSet(this.connection, this, resultSet);
        }
        return this.proxyResultSet;
    }


    public final <T> T unwrap(Class<T> iface) throws SQLException {
        if (iface.isInstance(this.delegate)) {
            return (T) this.delegate;
        }
        if (this.delegate != null) {
            return this.delegate.unwrap(iface);
        }

        throw new SQLException("Wrapped statement is not an instance of " + iface);
    }
}


*Location:D:\User\Xuan\Downloads\ajLeaderboards-1.3.3.jar\\us\ajg0702\leaderboards\libs\hikari\pool\ProxyStatement.class
 *Java compiler version:8(52.0)
         *JD-Core Version:1.1.3
